Ext.define('Projeto.view.ImageFilter', {
    extend: 'Ext.form.Panel',
    alias: 'widget.imagefilter',

    border: 0,
    margin: '5 5 0 5',

    initComponent: function() {
        this.items = [{
            xtype: 'fieldset',
            title: 'Filtros',
            defaults: {
                anchor: '100%',
                margin: '2 5 5 5'
            },
            layout: 'hbox',
            flex: 1,

            items: [{
                xtype: 'datefield',
                anchor: '100%',
                fieldLabel: 'De',
                labelWidth: 30,
                name: 'from_date',
                format: 'Y-m-d H:i:s',
                width: 150,
                maxValue: new Date()  // limited to the current date or prior
            }, {
                xtype: 'datefield',
                anchor: '100%',
                fieldLabel: 'Até',
                labelWidth: 30,
                name: 'to_date',
                format: 'Y-m-d H:i:s',
                width: 150,
                value: new Date()  // defaults to today
            }, {
            	xtype: 'combobox',
            	fieldLabel: 'Tipo',
            	name: 'type',
            	labelWidth: 30,
            	displayField: 'tipo',
            	valueField: 'tipo',
            	store: Ext.data.Store({
            		fields: ['tipo'],
            		data: [{tipo: '1'}, {tipo: '2'}, {tipo: '3'}, {tipo: '4'}]
            	}),
            	queryMode: 'local'
            }, {
            	xtype: 'combobox',
            	fieldLabel: 'Observatório',
            	name: 'observatory',
            	displayField: 'nome',
            	valueField: 'id',
            	store: 'Observatories',
            	queryMode: 'local'
            }, {
            	xtype: 'button',
            	text: 'Filtrar',
            	action: 'filter',
            	width: 100
            }]
        }];

        this.callParent(arguments);
    }
});

